File manager - Edit - /home/autoph/public_html/projects/event-registration-api/app/Models/User.php
Back
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class User extends Model { use HasFactory; protected $table = "golf_users"; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $guarded = [ ]; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; protected $with = ['company', 'position', 'club']; public function company() { return $this->hasOne( Company::class, 'id', 'company_id' ); } public function position() { return $this->hasOne( Position::class, 'id', 'position_id' ); } public function club() { return $this->hasOne( Club::class, 'id', 'club_id' ); } public function events() { return $this->belongsToMany( Event::class, EventParticipant::class, 'user_id', 'event_id' )->withPivot(['registration_date','status']); } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings